﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GenIX
{
    public partial class Name : Form
    {
        public Name()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            nameStyleT.Text = nameStyleT.Text.Trim();
            if (nameStyleT.Text == "")
            {
                MessageBox.Show("Имя стиля не указано !", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            foreach (string name in Styleform.listStyleName)
                if (name == nameStyleT.Text)
                {
                    MessageBox.Show("Выберите другое имя стиля !", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

            NewStyleForm styleForm = new NewStyleForm();
            this.Visible = false;
            styleForm.mood = true;
            styleForm.Text = "Создание нового стиля: " + nameStyleT.Text;
            styleForm.InitStyle(nameStyleT.Text);

            styleForm.ShowDialog();
            this.Close();


        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Name_Load(object sender, EventArgs e)
        {
            Styleform.SelectElement(this, Styleform.choseStyleName);
        }
    }
}
